import config from "@/config"
import http from "@/utils/request"

export default {
    stock: {
        url: `${config.API_URL}/adminapi/shop.ShopGoodsStock/lists`,
        name: "获取库存列表",
        get: async function(data={}){
            return await http.get(this.url, data);
        }
    },
    history:{
        url: `${config.API_URL}/adminapi/shop.contractOrder/historyPrice`,
        name: "历史价格",
        get: async function(data={}){
            return await http.get(this.url, data);
        }
    },
	//商品
	goods:{
		list: {
			url: `${config.API_URL}/adminapi/shop.ShopGoods/lists`,
			name: "获取商品列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		edit: {
			url: `${config.API_URL}/adminapi/shop.ShopGoods/edit`,
			name: "修改商品",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		add: {
			url: `${config.API_URL}/adminapi/shop.ShopGoods/add`,
			name: "添加商品",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/adminapi/shop.ShopGoods/delete`,
			name: "删除商品",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		update_status: {
			url: `${config.API_URL}/adminapi/shop.ShopGoods/changeStatus`,
			name: "修改商品状态",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		import: {
			url: `${config.API_URL}/adminapi/shop.shopGoods/import`,
			name: "导入",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
        setCate: {
			url: `${config.API_URL}/adminapi/shop.ShopGoods/batchSetCate`,
			name: "商品 -- 批量修改分类",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
	},
	//商品分类
	goodsCate:{
		list: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsCate/lists`,
			name: "获取商品分类列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
        all: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsCate/all`,
			name: "获取商品分类列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		edit: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsCate/edit`,
			name: "修改商品分类",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		add: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsCate/add`,
			name: "添加商品分类",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsCate/delete`,
			name: "删除商品分类",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		update_status: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsCate/update_status`,
			name: "修改商品分类状态",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
	},
    //商品单位
	goodsUnit:{
		list: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsUnit/lists`,
			name: "获取商品单位列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
        all: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsUnit/all`,
			name: "获取商品单位列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		edit: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsUnit/edit`,
			name: "修改商品单位",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		add: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsUnit/add`,
			name: "添加商品单位",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsUnit/delete`,
			name: "删除商品单位",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		update_status: {
			url: `${config.API_URL}/adminapi/shop.ShopGoodsUnit/update_status`,
			name: "修改商品单位状态",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
	},
    //产品标签
	goodsTag:{
		list: {
			url: `${config.API_URL}/adminapi/shop.ShopLabel/lists`,
			name: "获取产品标签列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
        all: {
			url: `${config.API_URL}/adminapi/shop.ShopLabel/all`,
			name: "获取产品标签列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		edit: {
			url: `${config.API_URL}/adminapi/shop.ShopLabel/edit`,
			name: "修改产品标签",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		add: {
			url: `${config.API_URL}/adminapi/shop.ShopLabel/add`,
			name: "添加产品标签",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/adminapi/shop.ShopLabel/delete`,
			name: "删除产品标签",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
	},
    //产品品牌
	goodsBrand:{
		list: {
			url: `${config.API_URL}/adminapi/shop.ShopBrand/lists`,
			name: "获取产品品牌列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
        all: {
			url: `${config.API_URL}/adminapi/shop.ShopBrand/all`,
			name: "获取产品品牌列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		edit: {
			url: `${config.API_URL}/adminapi/shop.ShopBrand/edit`,
			name: "修改产品品牌",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		add: {
			url: `${config.API_URL}/adminapi/shop.ShopBrand/add`,
			name: "添加产品品牌",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/adminapi/shop.ShopBrand/delete`,
			name: "删除产品品牌",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
	},
    //仓库
	ware:{
		list: {
			url: `${config.API_URL}/adminapi/shop.ShopWare/lists`,
			name: "获取仓库列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
        all: {
			url: `${config.API_URL}/adminapi/shop.ShopWare/all`,
			name: "获取仓库列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		edit: {
			url: `${config.API_URL}/adminapi/shop.ShopWare/edit`,
			name: "修改仓库",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		add: {
			url: `${config.API_URL}/adminapi/shop.ShopWare/add`,
			name: "添加仓库",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/adminapi/shop.ShopWare/delete`,
			name: "删除仓库",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
		detail: {
			url: `${config.API_URL}/adminapi/shop.ShopWare/detail`,
			name: "仓库详情",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
        position: {
			url: `${config.API_URL}/adminapi/shop.ShopWare/getPosition`,
			name: "获取库位",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
	},
    // bom
    bom:{
        list: {
            url: `${config.API_URL}/adminapi/shop.ShopBom/lists`,
            name: "获取bom列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        edit: {
            url: `${config.API_URL}/adminapi/shop.ShopBom/edit`,
            name: "修改bom",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/shop.ShopBom/add`,
            name: "添加bom",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/shop.ShopBom/delete`,
            name: "删除bom",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        detail: {
            url: `${config.API_URL}/adminapi/shop.ShopBom/detail`,
            name: "bom详情",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
    },
    // bom分类
    bomCate:{
        list: {
            url: `${config.API_URL}/adminapi/shop.ShopBomCate/lists`,
            name: "获取bom分类列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        all: {
            url: `${config.API_URL}/adminapi/shop.ShopBomCate/all`,
            name: "获取bom分类列表 -- 全部",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        edit: {
            url: `${config.API_URL}/adminapi/shop.ShopBomCate/edit`,
            name: "修改bom分类",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/shop.ShopBomCate/add`,
            name: "添加bom分类",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/shop.ShopBomCate/delete`,
            name: "删除bom分类",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
    },
    // 工序
    process:{
        list: {
            url: `${config.API_URL}/adminapi/production.WorkingProcedure/lists`,
            name: "获取工序列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
	    all: {
		    url: `${config.API_URL}/adminapi/production.WorkingProcedure/all`,
		    name: "获取工序列表",
		    get: async function(data={}){
			    return await http.get(this.url, data);
		    }
	    },
        edit: {
            url: `${config.API_URL}/adminapi/production.WorkingProcedure/edit`,
            name: "修改工序",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/production.WorkingProcedure/add`,
            name: "添加工序",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/production.WorkingProcedure/delete`,
            name: "删除工序",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        detail: {
            url: `${config.API_URL}/adminapi/production.WorkingProcedure/detail`,
            name: "工序详情",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
    },
    // 工艺
    craft:{
        list: {
            url: `${config.API_URL}/adminapi/production.WorkmanshipRoute/lists`,
            name: "获取工艺列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
	    all: {
		    url: `${config.API_URL}/adminapi/production.WorkmanshipRoute/all`,
		    name: "获取工艺列表",
		    get: async function(data={}){
			    return await http.get(this.url, data);
		    }
	    },
        edit: {
            url: `${config.API_URL}/adminapi/production.WorkmanshipRoute/edit`,
            name: "修改工艺",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/production.WorkmanshipRoute/add`,
            name: "添加工艺",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/production.WorkmanshipRoute/delete`,
            name: "删除工艺",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        detail: {
            url: `${config.API_URL}/adminapi/production.WorkmanshipRoute/detail`,
            name: "工艺详情",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
    },
    // 不良品项
    reason:{
        list: {
            url: `${config.API_URL}/adminapi/production.Rejects/lists`,
            name: "获取不良品项列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        all: {
            url: `${config.API_URL}/adminapi/production.Rejects/all`,
            name: "获取不良品项列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        edit: {
            url: `${config.API_URL}/adminapi/production.Rejects/edit`,
            name: "修改不良品项",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/production.Rejects/add`,
            name: "添加不良品项",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/production.Rejects/delete`,
            name: "删除不良品项",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        detail: {
            url: `${config.API_URL}/adminapi/production.Rejects/detail`,
            name: "不良品项详情",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
    },
    // 产品树
    mrp:{
        url: `${config.API_URL}/adminapi/counter.ShopCounter/getShop`,
        name: "树请求",
        post: async function(data={}){
            return await http.post(this.url, data);
        }
    },
}
